
from typing import Union, Optional
from pydantic import BaseModel
from src.enum.task import CrawlerTypeEnum

class WaybillParams(BaseModel):
    uni_code: str
    waybill_num: str

class VoyageLineParams(BaseModel):
    uni_code: str

class VesselScheduleParams(BaseModel):
    uni_code: str
    vessel_name: str
    voyage_line: Optional[str]
    voyage_number: Optional[str]
    orig_area: Optional[str]
    orig_port: Optional[str]
    dest_area: Optional[str]
    dest_port: Optional[str]
    departure_date: Optional[str]
    arrival_time: Optional[str]

class CrawlerRequest(BaseModel):
    crawler_type: CrawlerTypeEnum
    crawler_params: Union[WaybillParams | VoyageLineParams | VesselScheduleParams]